Skip to content

providers: degrade undeclared reasoning levels down the declared ladder - #599

Merged
caigee-cmd merged 4 commits into
caigee-cmd:mainfrom
guyu233:upstream/reasoning
Nov 27, 2026
Merged

caigee-cmd merged 4 commits into
caigee-cmd:mainfrom
guyu233:upstream/reasoning

Conversation

@guyu233

@guyu233 guyu233 commented Nov 27, 2026

Copy link
Copy Markdown
Contributor

Problem

ResolveReasoningLevel only degraded max / xhigh; every other undeclared level fell through to ReasoningDefault, which can be higher than what the client asked for. none on a model that cannot disable thinking was especially wrong: it was promoted to the model default instead of the cheapest thinking tier.

Change

  • internal/providers/reasoning.go: one neutral ladder (none < low < medium < high < xhigh < max). A declared level is forwarded untouched; an undeclared level walks down to the nearest declared lower tier and never up; a request below the model floor lands on the cheapest declared tier instead of the default. Unknown levels still fall back to the default.
  • internal/providers/workbuddy/mapping.go: none on a model that cannot turn thinking off uses LowestThinkingOption (the cheapest thinking tier) rather than the default switch.
  • LowestThinkingOption added for adapters that need an explicit off request to become the lowest thinking tier.

release.yml's explicit-version input from the same original commit is not included; this PR is provider behavior only.

Tests

  • go test ./internal/providers/... passes.
  • reasoning_test.go covers declared, undeclared-lower, below-floor, unknown and none cases; WorkBuddy toggle tests cover the no-off model path.

@caigee-cmd caigee-cmd left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Declared levels pass through unchanged; an undeclared level walks down the ladder and never up, and a request below the floor lands on the cheapest declared tier instead of the model default. Unknown levels still use the default. WorkBuddy's no-off path uses the cheapest thinking tier. Scoped to provider behavior; the release.yml change from the original commit is not here.

@caigee-cmd

Copy link
Copy Markdown
Owner

合入。声明过的档位原样转发;模型没声明的档位只向下退、不向上提;低于下限的请求落到最便宜的已声明档,不再退回可能更高的模型默认值。未知档位仍走默认值。release.yml 的显式版本改动没有带进来,这支只动供应商行为。

@caigee-cmd
caigee-cmd merged commit 5e811c5 into caigee-cmd:main Nov 27, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants